home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Graphics / Utilities / Movie Conversion / Movie Conversion / stack_-1.xml < prev   
Extensible Markup Language  |  1994-04-30  |  5KB  |  21 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>2</cardCount>
  7.     <cardID>2891</cardID>
  8.     <listID>2117</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>384</width>
  14.         <height>256</height>
  15.     </cardSize>
  16.     <script>---- Misc useful stuff--Function RectSize TheRect-- returns the size of a rectangle, as a point.Put (item 3 of TheRect) - (item 1 of TheRect) into item 1 of TheSizePut (item 4 of TheRect) - (item 2 of TheRect) into item 2 of TheSizeReturn TheSizeEnd RectSizeFunction CreateGWorld PixelDepth, GWorldBounds-- common routine for creating a GWorld in temporary memory.Put 4 into useTempMemReturn NewGWorld(PixelDepth, GWorldBounds, "", "", useTempMem)End CreateGWorld---- File name parsing--Function FindNumberSuffix InName-- recognizes a name of the form ‚Äú<anything><n>‚Äù-- where <n> is a sequence of one or more decimal digits,-- and returns the length of the part preceding the suffix.-- Returns empty if InName is not of this form.Put the length of InName into ThisPosRepeatIf ThisPos = 0 thenExit RepeatEnd IfGet char ThisPos of InNameIf it < "0" or it > "9" thenExit RepeatEnd IfSubtract 1 from ThisPosEnd RepeatIf ThisPos = the length of InName thenPut empty into ThisPosEnd IfReturn ThisPosEnd FindNumberSuffixFunction FileNamePart Pathname-- returns Pathname with prefixing volume and folder names stripped off.RepeatGet Offset(":", Pathname)If it = 0 or it = the length of Pathname thenExit RepeatEnd IfDelete char 1 to it of PathnameEnd RepeatReturn PathnameEnd FileNamePart---- Cleanup mechanism---- This makes sure that dynamic memory structures are-- freed if the user should prematurely terminate a-- handler with command-dot.---- Cleanup actions are accumulated in a global variable-- named ‚ÄúCleanup‚Äù; another global ‚ÄúCleanupLevel‚Äù is-- is used to allow multiple redundant cleanup calls-- at the same level without accidentally invoking outer-- cleanup code.---- This system isn‚Äôt 100% foolproof (it‚Äôs still possible for-- the user to hit command-dot between the allocation of-- dynamic memory and the addition of a cleanup action to-- free it, for example). But it‚Äôs better than nothing.-- Trying to make things 100% foolproof would involve messing-- with CantAbort, which I‚Äôm reluctant to do at this stage.--On AddCleanup CleanupAction-- remembers another action to be performed when cleaning up-- at the current level.Global CleanupPut CleanupAction & return before CleanupEnd AddCleanupFunction PushCleanup-- starts another nested level of cleanup actions.-- Returns the new level count so caller knows how far-- to pop.Global Cleanup, CleanupLevelPut "Put" && Quoted(Cleanup) && "into Cleanup" into Cleanup -- restores previous level of cleanup.AddCleanup "Put" && CleanupLevel && "into CleanupLevel"Add 1 to CleanupLevelReturn CleanupLevel - 1End PushCleanupOn PopCleanup ToLevel-- performs cleanup actions, up to the specified level.-- ToLevel is the value that the caller obtained from the-- previous matching call to PushCleanup.Global Cleanup, CleanupLevelRepeat while ToLevel < CleanupLevelSet cursor to busyDo CleanupEnd RepeatEnd PopCleanup---- Common parts of conversion code-- (redirected to get around script length limitations)--On CreateMovieSend the params to card id 3783End CreateMovieOn AddMovieFrameSend the params to card id 3783End AddMovieFrameOn FinishedMovieSend the params to card id 3783End FinishedMovie---- Top-level handlers--On OpenStackGlobal Cleanup, CleanupLevelGet EnterMovies()If it is not empty thenAnswer "Error" && it && "initializing Movie Toolbox"End IfPut 0 into CleanupLevelEnd OpenStackOn CloseStackExitMoviesEnd CloseStackOn IdleGlobal CleanupLevelIf CleanupLevel > 0 thenAnswer "Leftover cleanup to do."PopCleanup 0End IfEnd Idle---- If you want brief descriptions of the XCMDs and XFCNs attached-- to this stack, have a look in the card script of the first card.-- The descriptions were moved there from here because of HyperCard‚Äôs-- limitations on the length of scripts.--</script>
  17.     <background id="2659" file="background_2659.xml" name="Conversions" />
  18.     <card id="2891" file="card_2891.xml" marked="false" name="" owner="2659" />
  19.     <card id="3783" file="card_3783.xml" marked="false" name="Conversion Settings" owner="2659" />
  20. </stack>
  21.